package cn.glinks.liuhe.app;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import cn.glinks.liuhe.api.jsonbean.ParksInfo;
import cn.glinks.liuhe.model.Park;
import cn.glinks.liuhe.utils.GsonUtils;

/**
 * Des:AppConstant
 *
 * @author MarsBlade of Cyh
 * @created 2017-03-21 9:55
 */
public class AppConstant {

    /**
     * The constant DEBUG_TAG.
     */
    public static final String DEBUG_TAG = "Logger-Debug";// LogCat的标记

    /**
     * Bundle常用键名
     */
    public static final String BUNDLE_HISTORY_COMMENT = "bundle_history_comment";
    public static final String BUNDLE_HISTORY_TYPE = "bundle_history_type";
    public static final String BUNDLE_PARK_NAME = "bundle_park_name";
    public static final String BUNDLE_PARK_INDEX = "bundle_park_index";
    public static final String BUNDLE_PARK_LEVEL_NAME = "bundle_park_level_name";

    /**
     * 爱好界面相关
     */
    public final static String IS_INTEREST_CHANGED = "IS_INTEREST_CHANGED";
    public final static String BUNDLE_INTEREST_TAG_NAME = "BUNDLE_INTEREST_TAG_NAME";
    public final static String INTEREST_HOBBY = "爱好";
    public final static String INTEREST_SPORT = "运动";
    public final static String INTEREST_TRAVEL = "旅游";
    public final static String INTEREST_INTERCOURSE = "交往";
    public final static String INTEREST_LIVING = "居住";
    public final static String[] INTEREST_TAG_HOBBY =
            {"阅读", "运动", "美食", "旅游", "音乐", "影视", "DIY", "时尚", "汽车", "科技", "星座", "游戏"};
    public final static String[] INTEREST_TAG_SPORT =
            {"球类运动", "跑步", "徒步", "登山", "射击", "射箭", "骑马", "游泳", "钓鱼", "滑冰(雪)", "拳击", "健身", "棋牌类"};
    public final static String[] INTEREST_TAG_TRAVEL =
            {"国内", "国际", "自驾", "风景", "人文", "城市", "海岛"};
    public final static String[] INTEREST_TAG_INTERCOURSE =
            {"线上私聊", "线上群聊", "二人聚会", "多人聚会"};
    public final static String[] INTEREST_TAG_LIVING =
            {"集体宿舍", "自己租房", "朋友合租", "父母同住", "独立住房"};


    /**
     * 性格界面相关
     */
    public final static String INTEREST_CHARACTER = "性格";
    public final static String[] INTEREST_TAG_CHARACTER =
        {"谨慎", "乐观", "消极", "自信", "内向", "神经质", "敏锐", "耿直", "自以为是", "性情易变",
            "机灵", "热心", "理智型", "兴奋型", "有个性", "有支配欲", "行动型", "细致", "勤俭",
            "喜欢自我决策", "有责任心", "易动感情", "有进取心", "独断", "其他"};

    /**
     * 全局存储相关的Key名
     */
    public final static String SP_KEY_COMPANY_JSON = "sp_key_company_json";


    public final static String getTestJson() {
        ParksInfo info = new ParksInfo();
        List<ParksInfo.ParksBean> list = new ArrayList<>();

        list.add(loadParkBean("沈阳", Park.LEVEL_CITY_1, Park.ALIGN_RIGHT, 41.796767, 123.429096));
        list.add(loadParkBean("营口", Park.LEVEL_CITY_2, Park.ALIGN_RIGHT, 40.667432, 122.235152));
        list.add(loadParkBean("大连", Park.LEVEL_CITY_2, Park.ALIGN_RIGHT, 38.91459, 121.618622));
        list.add(loadParkBean("北京", Park.LEVEL_PROVINCE, Park.ALIGN_RIGHT, 40.080525, 116.603039));
        list.add(loadParkBean("天津", Park.LEVEL_PROVINCE, Park.ALIGN_RIGHT, 39.125596, 117.190182));
        list.add(loadParkBean("廊坊", Park.LEVEL_CITY_2, Park.ALIGN_LEFT, 39.523927, 116.704441));
        list.add(loadParkBean("大同", Park.LEVEL_CITY_2, Park.ALIGN_RIGHT, 40.09031, 113.295259));
        list.add(loadParkBean("太原", Park.LEVEL_CITY_1, Park.ALIGN_RIGHT, 37.857014, 112.549248));
        list.add(loadParkBean("晋城", Park.LEVEL_CITY_2, Park.ALIGN_LEFT, 35.497553, 112.851274));
        list.add(loadParkBean("烟台", Park.LEVEL_CITY_2, Park.ALIGN_RIGHT, 37.539297, 121.391382));
        list.add(loadParkBean("郑州", Park.LEVEL_CITY_1, Park.ALIGN_RIGHT, 34.741806, 113.613533));
        list.add(loadParkBean("洛阳", Park.LEVEL_CITY_2, Park.ALIGN_LEFT, 34.663041, 112.434468));
        list.add(loadParkBean("济源", Park.LEVEL_CITY_2, Park.ALIGN_RIGHT, 33.957691, 114.333553));
        list.add(loadParkBean("南阳", Park.LEVEL_CITY_2, Park.ALIGN_LEFT, 32.999082, 112.540918));
        list.add(loadParkBean("西华", Park.LEVEL_CITY_2, Park.ALIGN_RIGHT, 32.413101, 114.025936));
        list.add(loadParkBean("淮安", Park.LEVEL_CITY_2, Park.ALIGN_LEFT, 33.597506, 119.021265));
        list.add(loadParkBean("盐城", Park.LEVEL_CITY_2, Park.ALIGN_RIGHT, 33.377631, 120.139998));
        list.add(loadParkBean("南通", Park.LEVEL_CITY_2, Park.ALIGN_RIGHT, 32.016212, 120.864608));
        list.add(loadParkBean("常熟", Park.LEVEL_CITY_2, Park.ALIGN_LEFT, 31.654376, 120.752481));
        list.add(loadParkBean("昆山", Park.LEVEL_CITY_2, Park.ALIGN_LEFT, 31.385598, 120.980737));
        list.add(loadParkBean("南京", Park.LEVEL_CITY_1, Park.ALIGN_LEFT, 32.041544, 118.767413));
        list.add(loadParkBean("嘉善", Park.LEVEL_CITY_2, Park.ALIGN_LEFT, 30.830898, 120.92585));
        list.add(loadParkBean("上海", Park.LEVEL_PROVINCE, Park.ALIGN_RIGHT, 31.231706, 121.472644));
        list.add(loadParkBean("杭州", Park.LEVEL_CITY_1, Park.ALIGN_RIGHT, 30.287459, 120.153576));
        list.add(loadParkBean("武汉", Park.LEVEL_CITY_1, Park.ALIGN_RIGHT, 30.580438, 114.29112));
        list.add(loadParkBean("重庆", Park.LEVEL_CITY_1, Park.ALIGN_RIGHT, 29.533155, 106.504962));
        list.add(loadParkBean("成都", Park.LEVEL_CITY_1, Park.ALIGN_RIGHT, 30.659462, 104.065735));
        list.add(loadParkBean("长沙", Park.LEVEL_CITY_1, Park.ALIGN_LEFT, 28.19409, 112.982279));
        list.add(loadParkBean("株洲", Park.LEVEL_CITY_2, Park.ALIGN_RIGHT, 27.835806, 113.151737));
        list.add(loadParkBean("衡阳", Park.LEVEL_CITY_2, Park.ALIGN_RIGHT, 26.88949, 112.631311));
        list.add(loadParkBean("南昌", Park.LEVEL_CITY_1, Park.ALIGN_RIGHT, 28.676493, 115.892151));
        list.add(loadParkBean("赣州", Park.LEVEL_CITY_2, Park.ALIGN_RIGHT, 25.85097, 114.940278));
        list.add(loadParkBean("南宁", Park.LEVEL_CITY_2, Park.ALIGN_LEFT, 22.82402, 108.320004));
        list.add(loadParkBean("北海", Park.LEVEL_CITY_2, Park.ALIGN_LEFT, 21.473343, 109.119254));
        list.add(loadParkBean("佛山", Park.LEVEL_CITY_2, Park.ALIGN_LEFT, 23.028762, 113.122717));
        list.add(loadParkBean("东莞", Park.LEVEL_CITY_2, Park.ALIGN_RIGHT, 23.046237, 113.746262));
        list.add(loadParkBean("中山", Park.LEVEL_CITY_2, Park.ALIGN_LEFT, 22.521113, 113.382391));
        list.add(loadParkBean("惠州", Park.LEVEL_CITY_2, Park.ALIGN_RIGHT, 23.079404, 114.412599));
        list.add(loadParkBean("深圳", Park.LEVEL_CITY_1, Park.ALIGN_RIGHT, 22.547, 114.085947));

        info.setParks(list);

        return GsonUtils.toJson(info);
    }

    public final static ParksInfo.ParksBean loadParkBean(String name, int level, int align,
                                                         double lat, double lng) {
        ParksInfo.ParksBean parksBean = new ParksInfo.ParksBean();

        // 基本数据
        parksBean.setParkName(name);
        parksBean.setParkLevel(level);
        parksBean.setNameAlign(align);
        parksBean.setLat(lat+"");
        parksBean.setLng(lng+"");

        // 随机数据
        List<Integer> list;
        Random random = new Random();
        list = new ArrayList<>();
        for (int i = 0; i < 12; i++) {
            list.add(random.nextInt(51));//产生0-100的伪随机数
        }
        parksBean.setL1(list);

        list = new ArrayList<>();
        for (int i = 0; i < 12; i++) {
            list.add(random.nextInt(101));//产生0-100的伪随机数
        }
        parksBean.setL2(list);

        list = new ArrayList<>();
        for (int i = 0; i < 12; i++) {
            list.add(random.nextInt(251));//产生0-100的伪随机数
        }
        parksBean.setL3(list);

        list = new ArrayList<>();
        for (int i = 0; i < 12; i++) {
            list.add(random.nextInt(81));//产生0-100的伪随机数
        }
        parksBean.setL4(list);

        list = new ArrayList<>();
        for (int i = 0; i < 12; i++) {
            list.add(random.nextInt(11));//产生0-100的伪随机数
        }
        parksBean.setL5(list);

        // 总数
        parksBean.setTestPop(parksBean.getTestSum());
        parksBean.setPop(parksBean.getTestPop()+random.nextInt(1001));//产生0-1000的伪随机数

        return parksBean;
    }

}
